/********************************************************************************
 *      Copyright:  (C) 2025 huangxiangming<1732012962@qq.com>
 *                  All rights reserved.
 *
 *       Filename:  proc.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(25/04/20)
 *         Author:  huangxiangming<1732012962@qq.com>
 *      ChangeLog:  1, Release initial version on "25/04/20 20:08:01"
 *                 
 ********************************************************************************/
//包含保护
#ifndef PROC_H
#define PROC_H

#include <signal.h>
#include <sys/types.h>

#define PID_SIZE		11

typedef struct proc_signal_s
{
	unsigned		alarm_flag;     //时钟标志(1发送0停止)
	unsigned  		stop;    
}  proc_signal_t;

extern proc_signal_t    g_signal;

void install_signal(int times);

int set_background_running(int daemon_flag, char *pidfile);

int check_background_running(char *pidfile);

pid_t get_daemon_pid(char *pidfile);

int record_daemon_pid(char *pidfile);

int stop_background_running(char *pidfile);
#endif
